<?php
$url = $_GET['url'];
$html = file_get_contents($url);
if( preg_match("#<title>(.+)<\/title>#iU", $html, $t))  {
  $title = trim($t[1]);
} else {
  $title = 'undefined...';
}

echo $title;
?>